<?php 
namespace Home\Model;
use Think\Model;
class LogModel extends Model 
{
    public function addLog($openid, $sid)
    {
        if(empty($openid))
            return false;
        $add = array(
            'openid'    => $openid,
            'time'      => time(),
            'ip'        =>  $_SERVER["REMOTE_ADDR"]
        );
        $add['sid'] = 0;
        if(!empty($sid))
            $add['sid']=$sid;
        $this->add($add);
        return true;
    }
}
